<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>模板返利网－买模板返现金，免费装修，淘宝店铺装修模板免费买</title>
        <link rel="stylesheet" type="text/css" href="/Public/css/default.css" />
        <script type="text/javascript" src="__ROOT__/Public/js/jquery.min.js"></script>
        <script type="text/javascript" src="__ROOT__/Public/js/jquery.form.js"></script>
        <script type="text/javascript" src="__ROOT__/Public/js/operamasks-ui.min.js"></script>
        <script src="http://a.tbcdn.cn/s/kissy/1.1.6/seed-min.js"></script>
        <script src="http://a.tbcdn.cn/apps/pamirsshop/wiki/scripts/wiki.js"></script>
    </head>

    <body onload="bhtml()">
        <div id="edit"></div>
        <div id="meng"></div>
        <div id="tips"></div>
        <div id="hd">
            <div class="logo">
                <h1><embed height="80" width="220" flashvars="bannerWidth=220&bannerHeight=80&bannerSID=http://img1.tbcdn.cn/tfscom/T1ZGRPXsNeXXXgzXjX.xml&bannerXML=&bannerLink=http%3A%2F%2F&dataSource=&bid=35354065&appSource=default" wmode="transparent" allowscriptaccess="always" quality="high" name="35354065" id="35354065" style="" src="http://img.uu1001.cn/bcv3.swf?v=20121219" type="application/x-shockwave-flash"/></embed></h1>
                <p class="top1">
                    售前QQ:1870255432；售后QQ:1870255432&nbsp;&nbsp;<a href="__APP__/Help/index">网站地图</a>&nbsp;&nbsp;<a href="__APP__/Help/index" target="_blank">收藏本站</a>
                </p>
                <p class="top2">
                    您好，欢迎来到模板返利网&nbsp;
                    <?php if(empty($_SESSION['userid'])): ?>[<a href="__APP__/Public/login">登录</a>]&nbsp;&nbsp;[<a href="__APP__/Public/register">免费注册</a>]
                        <?php else: ?>
                        &nbsp;<a href="__APP__/User/orderlist">我的订单</a>&nbsp;&nbsp;<a href="__APP__/User/index">会员中心</a>&nbsp;&nbsp;<a href="__APP__/Public/logout">安全退出</a><?php endif; ?>
                    &nbsp;&nbsp;<a href="__APP__/Help/index">帮助中心</a>
                </p>
            </div>
            <div class="nav">
                <ul class="menu">
                    <li <?php if(($module_name == 'Index') and ($action_name == 'index')): ?>class="curli"<?php endif; ?>><a href="__APP__"><span>首页</span></a></li>
                    <li <?php if($module_name == 'Temp'): ?>class="curli"<?php endif; ?>><a href="__APP__/Temp"><span>所有模板</a></span></li>
                    <li <?php if(($module_name == 'Index') and ($action_name == 'jiaocheng')): ?>class="curli"<?php endif; ?>><a href="__APP__/Index/jiaocheng"><span>返利教程（必读）</a></span></li>
                    <li <?php if(($module_name == 'Index') and ($action_name == 'cooperation')): ?>class="curli"<?php endif; ?>><a href="__APP__/Index/cooperation"><span>商业合作</a></span></li>      
                    <?php if(!empty($_SESSION['userid'])): ?><li <?php if($module_name == 'User'): ?>class="curli"<?php endif; ?>><a href="__APP__/User/index"><span>会员中心</a></span></li><?php endif; ?>
                </ul>
            </div>
        </div>
        <script type="text/javascript">
            function qbot(){
                $("#tips").hide();
                $("body").css({"overflow":"auto"});
            }
            function query(i){
                var f = $('#formwork option:selected').val();
                var t = $('#trade option:selected').val();
                var c = $('#color option:selected').val();
                var s = $('#sty option:selected').val();
				var r = $('#rate option:selected').val();
                var n = $('#num').val();
                $.get('__URL__/addsty/f/'+f+'/t/'+t+'/c/'+c+'/s/'+s+'/id/'+i+'/n/'+n+'/r/'+r,function(data){
                    if(data == 1){
                        $("#tips").hide();
                        $("body").css({"overflow":"auto"});
                        var h = window.screen.height;
                        var w = window.screen.width;
                        $("#tips").css({"left":(w/2-100)+"px","top":(h/2-100)+"px","display":"block"});
                        $("#tips").html('<div style="font-size:12px; padding:10px;">修改成功</div>').animate({opacity: 'hide'}, 2000);
						document.location.reload();		
                    }
                    if(data == 0){
                        alert("上架后的模板，不允许设置属性为空");
                    }
                });
            }
            function bhtml(){
                var id = '<?php echo ($temp["id"]); ?>';
                $.get("__URL__/qhtml/id/"+id,function(data){
                    $("#ht").html(data);
                });
            }
        </script>

<div id="bd">
    <div class="left1">
        <script type="text/javascript">
	$(document).ready(function(e) {
        $(".userMenu li").mouseover(function(){
			$(this).css("background-color","#FFFAE2");
			});
		 $(".userMenu li").mouseleave(function(){
			$(this).css("background-color","#fff");
			});	
    });
</script>
<div class="usercenter">
    <div class="hd"></div>
    <div class="bd">
        <ul class="userMenu">
            <li><a href="__URL__/index">用户概况</a></li>
            <li><a href="__URL__/update">修改资料</a></li>
            <li><a href="__URL__/changepwd">修改密码</a></li>
            <?php if($_SESSION['type']== 1): ?><li><a href="__URL__/temps">我的模板</a></li><?php endif; ?>
            <li><a href="__URL__/orderlist">我的订单</a></li>
            <li><a href="__URL__/chongzhi">现金充值</a></li>
            <li><a href="__URL__/tixian">提现申请</a></li>
            <li><a href="__URL__/zdmx">账单明细</a></li>
        </ul>
    </div>
</div>

    </div>
    <div class="right1">    	
        <div class="list J_TWidget" data-widget-type="Tabs" data-widget-config="{
                'triggerType':'click'
            }" style="margin-top:0;">
            <ul class="ks-switchable-nav">
                <li class="ks-active">我的模板</li>                   
            </ul>
            <div class="contents">
                <div class="ks-switchable-content">
                    <div>
                    <div class="ops"><a href="javascript:void(0);" id="gettemps">一键获取所有模板</a><a href="addtemp">手动添加模板</a></div>
<div class="templist">
    <?php if(!empty($templist)): ?><form action="__URL__/temp_admin" method="post" id="tempsForm">
            <div class="topadmin">
                <span>选择操作：</span><select name="action" id="action">        	
                    <option value="del">删除</option>
                    <option value="up">上架</option>
                    <option value="down">下架</option>
                    <option value="rate">设置比例</option>
                </select>
                <span id="setrate"><span>比例：</span><select name="rate">
                        <option value="1">100%</option>
                        <option value="0.7">70%</option>
                        <option value="0.5">50%</option>
                    </select></span>
                <input type="submit" id="submit" value="提交" />
            </div>
            <div class="list-title">
                <span class="id"><input type="checkbox" onclick="reverse(this)"  id="checkall" value=""  /></span>
                <span class="title">标题</span>
                <span class="frontpage">缩略图</span>
                <span class="price">价格</span>
                <span class="count">市场销量</span>
                <span class="count1">本站销量</span>
                <span class="rate">返现比例</span>
                <span class="status">状态</span>
                <span class="op">管理</span>
            </div>
            <?php if(is_array($templist)): $i = 0; $__LIST__ = $templist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><div class="temp-item">
                    <?php if($up == 1): if($v['status'] == 0): ?><div class="po" id="<?php echo ($v["id"]); ?>">模板上架失败，请编辑完善模板信息</div><?php endif; endif; ?>
                    <div class="po" style="display: none;" id="<?php echo ($v["id"]); ?>">模板上架失败，请编辑完善模板信息</div>
                    <span class="id"><input type="checkbox" name="id[]" value="<?php echo ($v["id"]); ?>"  /></span>
                    <span class="title"><a target="_blank" title="访问模板" href="http://<?php if($v["type"] == 1): ?>zxn<?php else: ?>zx<?php endif; ?>.taobao.com/detail.htm?id=<?php echo ($v["id"]); ?>"><?php echo ($v["title"]); ?></a></span>
                    <span class="frontpage"><img src="<?php echo ($v["frontpage"]); ?>" style="width:80px;height:125px;" /></span>
                    <span class="price"><?php echo ($v["price"]); ?></span>
                    <span class="count"><?php echo ($v["count"]); ?></span>
                    <span class="count1"><?php echo ($v["count1"]); ?></span>
                    <span class="rate"><?php echo ($v['rate']*100); ?>%</span>
                    <span class="status"><?php if($v["status"] == 0): ?>下架<?php else: ?><em  style="color: red;">上架</em><?php endif; ?></span>
                    <span class="op">
                        <?php if($v["status"] == 0): ?><a href="javascript:;" onclick="grounding('<?php echo ($v["id"]); ?>',0)" title="设置为上架">上架</a>
                            <?php else: ?>
        	<a href="javascript:;" onclick="grounding('<?php echo ($v["id"]); ?>',1)" title="设置为下架">下架</a><?php endif; ?>       
                        <a href="javascript:;" onclick="edit('<?php echo ($v["id"]); ?>')">编辑</a>
                        <a href="__URL__/deltemp/id/<?php echo ($v["id"]); ?>" onclick="return a=confirm('确认删除？')" title="点击删除">删除</a>
                    </span>
                </div><?php endforeach; endif; else: echo "" ;endif; ?>
            <div class="pages" style="margin:10px 0;"><?php echo ($page); ?></div>
        </form>
        <?php else: ?>
        <div class="no-jilu">
            暂无模板记录
        </div><?php endif; ?>
</div>

<script type="text/javascript">
    $(document).ready(function(e) {	
		$('#tips').omDraggable({handle:"h3"});	
        var h = window.screen.height;
        var w = window.screen.width;	
        $("#meng").css({"width":w+"px","height":h+"px"});
        $("#tips").css({"left":(w/2-100)+"px","top":(h/2-100)+"px"});
        $(".temp-item").mouseover(function(){
            $(this).css("background-color",'#eee');
        });	
        $(".temp-item").mouseleave(function(){
            $(this).css("background-color",'#fff');
        });	
        $("#gettemps").click(function(){
            if(confirm("一键获取会将您在淘宝装修市场的所有模板都获取到本站数据库中，但是否展示，由您自由操作。")){
                var name=prompt("请输入您的设计师账号","");
                if(name==""){
                    alert("设计师账号不得为空");
                    return false;		
                }
                else if(!name) return false;	
                $("#meng").fadeIn();
                $("#tips").html("<img src='/Public/images/wait.gif' width='100' /><br/>正在加载，请稍候").show();			
                $.post("__URL__/gettemps",{'designer':name},function(data){						
                    document.location.reload();
                },'json')
            }
        });	
        $("#tempsForm").submit(function(){			
            if($(":checkbox:checked").length==0){
                alert("请先选择模板");
                return false;
            }
        });	
        $("#action").change(function(){
            if($(this).val()=="rate") $("#setrate").show();
            else $("#setrate").hide();
        });
			
    });	
    function reverse(dom){  //全选与反选 
        $(".templist :checkbox").each(function () {  
            $(this).attr("checked", !$(this).attr("checked"));  
        });
        $(dom).attr("checked", !$(dom).attr("checked"));
    }	
    //编辑
    function edit(id){
        $.get('__URL__/selectid/id/'+id,function(data){
            $("#tips").html(data);
        });
        var h = window.screen.height;
        var w = window.screen.width;
        $("body").css({"overflow-Y":"hidden"});
        $("#tips").css({"left":(w/2-100)+"px","top":(h/2-100)+"px","display":"block"});
    }
    //上架
    function grounding(i,s){
        $.get('__URL__/changestatus/id/'+i+'/s/'+s,function(data){
            if(data == 1){
                location.reload() ;
            }else{
                $("#"+i).show();
            }
//             $("#idjs").html(data);
        });
    }

    
</script>
                    </div>                       
                </div>
            </div>               
        </div>        
    </div>
</div>
</body>
</html>